<%-- 
    Document   : CMS_orderStatus
    Created on : Nov 24, 2013, 3:06:01 PM
    Author     : BibooChung
--%>




<!DOCTYPE html>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import = "java.util.*" import="cart.hibernate.orderStatus.*" import="cart.*,java.net.*,java.text.*" %>
<jsp:useBean id = "manager" scope= "request" class = "cart.hibernate.orderStatus.ManageOrderStatus" />

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
        <script type="text/javascript" src="js/bootstrap.min.js"></script>
        <script type="text/javascript" src="js/CMS.js"></script>
        <link type="text/css" href="css/CMS.css" rel="stylesheet" />
        <link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
        <link href="css/font-awesome.min.css" rel="stylesheet" media="screen">
        <link href="css/bootflat.css" rel="stylesheet" media="screen">
        <link href="css/bootflat-extensions.css" rel="stylesheet" media="screen">
        <link href="css/bootflat-square.css" rel="stylesheet" media="screen">
    </head>
    <body>
        <jsp:include page="CMS_menu.html" />
        <h1>Manage Order Status</h1>

        <!-- Table with integrated management -->
        <table style="margin-bottom:20px;" class="table table-striped">
            <thead>
                <tr>
                    <th>Order Status ID</th>
                    <th>Order Status</th>
                    <th>Update?</th>
                    <th>Delete?</th>
                </tr>
            </thead>
            <tbody>
                <%
                    List orderStatusList = manager.getAllOrderStatus();
                    Iterator iter = orderStatusList.iterator();

                    while (iter.hasNext())
                    {

                        OrderStatus orderStatus = (OrderStatus) iter.next();
                %>
                        <tr>
                            <form action="ManageOrderStatusServlet" method="post">
                                <input type="hidden" name="orderStatusId" value="<%= orderStatus.getOrderStatusId() %>">
                                <td>
                                    <%= orderStatus.getOrderStatusId() %>
                                </td>
                                <td>
                                    <input type="text" name="orderStatus" value="<%= orderStatus.getOrderStatus() %>" class="form-control" />
                                </td>
                                <td>
                                    <input type="submit" name="submit" value="update" class="btn btn-primary">
                                </td>
                                <td>
                                    <input type="submit" name="submit" value="delete" class="btn btn-danger">
                                </td>
                            </form>
                        </tr>
                <%        
                    }
                %>
            </tbody>
        </table>
        <table>
            <tr>
                <form action="ManageOrderStatusServlet" method="post">
                    <td>Enter new orderStatus : </td>
                    <td><input type="text" name="orderStatus" id="orderStatus" placeholder="Order Status" class="form-control" /></td>
                    <td><input type="submit" name="submit" value="add" class="btn btn-primary"></td>
                </form>
            </tr>
        </table>
    </body>
</html>
